home *** CD-ROM | disk | FTP | other *** search
- package com.sun.java.swing.plaf.basic;
-
- import com.sun.java.swing.AbstractAction;
- import java.awt.event.ActionEvent;
- import java.io.Serializable;
-
- class BasicTreeUI$TreeHomeAction extends AbstractAction implements Serializable {
- // $FF: synthetic field
- BasicTreeUI this$0;
- private int direction;
-
- // $FF: synthetic method
- public BasicTreeUI$TreeHomeAction(BasicTreeUI this$0, int direction, String name) {
- super(name);
- this.this$0 = this$0;
- this.direction = direction;
- }
-
- public void actionPerformed(ActionEvent e) {
- int rowCount = this.this$0.getRowCount();
- if (this.this$0.tree != null && rowCount > 0) {
- if (this.direction == -1) {
- this.this$0.ensureRowsAreVisible(0, 0);
- this.this$0.tree.setSelectionInterval(0, 0);
- } else {
- this.this$0.ensureRowsAreVisible(rowCount - 1, rowCount - 1);
- this.this$0.tree.setSelectionInterval(rowCount - 1, rowCount - 1);
- }
- }
-
- }
-
- public boolean isEnabled() {
- return this.this$0.tree != null && this.this$0.tree.isEnabled();
- }
- }
-